package com.example.day2.mvvm.base;

import android.os.Bundle;
import android.os.PersistableBundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

/**
 * 不需要加载数据，即不需要ViewModel的基础类
 * @param <VDB>
 */
public abstract class BaseViewActivity <VDB extends ViewDataBinding>extends AppCompatActivity {
    protected VDB binding;



    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,bindLayoutId());

        initView();
        initData();
    }

    public abstract void initView();

    public abstract void initData();

    public abstract int bindLayoutId();
}
